﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using SharedGenomics.Core;

namespace SharedGenomics.Workbench.Core
{
    /// <summary>
    /// This is a mock implementation of the ILoginRequiredGuard interface - it simply executes the given action rather than performing anything login-related
    /// since the tests can assume the guard will do the right thing
    /// </summary>
    public class TestLoginGuard : ILoginRequiredGuard
    {
        public void Guard(Action act)
        {
            act();
            this.WasCalled = true;
        }

        public void Guard(Action<UserCredentials> credentialAction)
        {
            UserCredentials c = new UserCredentials("testUser", "password".ToSecureString());
            credentialAction(c);
        }

        public bool WasCalled { get; private set; }
    }
}
